home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
libs
/
netclb23
/
examples.exe
/
STIME.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-05-20
|
2KB
|
50 lines
/***************************************************************************/
/* File: STIME.C */
/* */
/* Function: Output current server date and time. */
/* */
/* Usage: stime */
/* */
/* Functions Called: GetFileServerDateTime */
/* GetPreferredConnectionID */
/* GetDefaultConnectionID */
/* GetPrimaryConnectionID */
/* SetPreferredConnectionID */
/* ISShellLoaded */
/* */
/***************************************************************************/
#include "netware.h"
#include <stdio.h>
static char *days[] = { "Sunday" , "Monday" , "Tuesday" , "Wednesday" ,
"Thursday" , "Friday" , "Saturday" };
void main( void )
{
int h,m,s,d,mth,y,dow;
int thisserver,prefserver;
if (IsShellLoaded() != SUCCESS)
{
printf("*** No netware shell loaded ***\n");
return;
}
if ((prefserver = GetPreferredConnectionID()) == 0)
{
if ((thisserver = GetDefaultConnectionID()) == 0)
thisserver = GetPrimaryConnectionID();
SetPreferredConnectionID( thisserver );
}
else
thisserver = prefserver;
GetFileServerDateTime(&h,&m,&s,&d,&mth,&y,&dow);
printf("Today is %s\n",days[dow]);
printf("%02.2d-%02.2d-%04.4d__%02.2d:%02.2d:%02.2d\n",
d,mth,y,h,m,s);
if (thisserver != prefserver) /* reset preferred server */
SetPreferredConnectionID( prefserver );
}